<?php
require("./gigJunkieXmlParser.php");

$xmlParser = new gigJunkieXmlParser();

$xmlParser->setGenre('rock-pop');
$xmlParser->setStartDate('2010-03-13');
$xmlParser->setPageSize(30);
$xmlParser->setLatitude(51.51);
$xmlParser->setLongitude(-0.11);

/**
 * Try to fetch some events
 */
if (($events = $xmlParser->fetchEvents()) === false) {
    /**
     * There was a problem either fetching or parsing the XML
     */
    print("Error! " . $xmlParser->fetchErrorMessage());
    exit;
}

/**
 * Successfully fetched and parsed the events XML. Display the results.
 */
print("URL: " . $xmlParser->constructRequestUrl());
print("\n\n<br /><br />Total result count = " . $xmlParser->fetchResultCount());
print("\n\n<br /><br />" . $xmlParser->morePagesToFetch() . " more pages to fetch.");

foreach ($events as $key => $event) {
    print("\n\n<br /><br /><strong>{$key})</strong> ");
    print_r($event);
}

